package cn.xinfei.xdecision.common.service.component.decisiontree;

import cn.xinfei.xdecision.common.model.common.PageResult;
import cn.xinfei.xdecision.common.model.common.ResponseEntityDto;
import cn.xinfei.xdecision.common.model.component.CopyToFolderReqVo;
import cn.xinfei.xdecision.common.model.component.decisiontree.DecisionTree;
import cn.xinfei.xdecision.common.model.component.decisiontree.vo.DecisionTreeVo;
import cn.xinfei.xdecision.common.model.component.request.ListParam;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DecisionTreeService extends IService<DecisionTree> {

    DecisionTreeVo queryById(Long id);

    ResponseEntityDto<PageResult<List<DecisionTreeVo>, DecisionTree>> queryByEntity(ListParam listParam);

    boolean updateStatus(List<Long> ids, Integer status);

    boolean updateFolder(List<Long> ids, Long folderId);

    List<String> queryFieldEnByVersionId(Long versionId);

    // runner
    DecisionTreeVo queryExecuteDecisionTree(String decisionTreeCode, Long versionId);
    DecisionTreeVo queryExecuteDecisionTreeByVersionNo(String decisionTreeCode, Long versionNO);

    List<Long> getNodeFieldIds(Long versionId);

    /**
     * 修改规则
     */
    void updateDecisionTree(List<Long> ids, Integer status, String errorMsg);

    Long checkAndSaveTrees(DecisionTreeVo decisionTreeVo);

    void copyDecisionTree(CopyToFolderReqVo req);

    void saveDecisionTree(DecisionTreeVo decisionTreeVo);

    List<Long> queryByFolderId(@Param("folderId") Long folderId);

    void logicalDelete(List<Long> ids);
}
